﻿using _1_Interfaces.Interfaces.Cjw;
using _1_Interfaces.Models.Tables.Cjw;
using _2_Services;
using AutoMapper;
using SqlSugar;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;

namespace _2_Services.Services.Cjw
{
    /// <summary>
    /// 职位管理
    /// </summary>
    public class PositionService : IPositionService 
    {
        SqlSugarClient _db = CjwDbContext.GetInstance();
        private IMapper _mapper;

        public PositionService(IMapper mapper)
        {
            _mapper = mapper;
        }

        /// <summary>
        /// 获取职位表
        /// </summary>
        /// <returns></returns>
        public List<PositionList> GetPositionList()
        {
            return _db.Queryable<PositionList>()
                .Where(x => x.PositionState == 1)
                .ToList();
        }
    }
}
